<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="../../css/utils/bootstrap.min.css" />
    <link rel="stylesheet" href="../../css/utils/toastr.min.css" />
    <link rel="stylesheet" href="../../css/utils/mui.min.css" />
    <link rel="stylesheet" href="../../css/utils/common.css?version=3" />
	<title></title>
	<style>
		.row-list {
			margin-top: 20px;
		}
		.row-list .thumbnail {
			padding: 8px;
			border: none;
			background: url(../../img/myExtension/content-back.png) no-repeat;
			background-size: 100% 100%;
		}
		.img-layer {
			position: relative;
		}
		.img-layer .main-img {
			height: 166px;
			width: 100%;
			display: block;
		}
		.float-btn {
			margin-top: 30px;
			text-align: center;
		}
		.float-btn .btn {
			width: 158px;
		    background-color: #11B5AB;
		    color: #fff;
		    border-color: #11B5AB;
		    cursor: pointer;
		    opacity: 1;
		}
		.float-btn p .btn:nth-child(2) {
			margin-left: 10px;
		}
		.float-btn .btn:focus, .float-btn .btn:hover {
			color: #fff;
			background-color: #2aeee2;
		}
		.btn-background {
			width: 158px;
			height: 34px;
			margin: 0 auto;
			margin-bottom: 6px;
		    background-color: #11B5AB;
		    color: #fff;
		    text-align: center;
	        border-radius: 4px;
		    line-height: 34px;
		    cursor: pointer;
		}
		.float-bottom {
			position: absolute;
			left: 0;
			bottom: 10px;
			width: 100%;
			color: #fff;
		}
		.float-bottom .delete {
			float: left;
			margin-left: 20px;
			cursor: pointer;
		}
		.float-bottom .edite {
			float: right;
			margin-right: 20px;
			cursor: pointer;
		}
		.float-bottom img {
			margin-right: 8px;
			vertical-align: middle;
		}
		.float-bottom span {
			vertical-align: middle;
		}
		.row-list .caption {
			position: relative;
		}
		.icon-bar {
			height: 20px;
		}
		.icon-bar img {
			width: 14px;
			height: 14px;
			margin-right: 5px;
		}
		.push-time {
			color: #8B8B8B;
		}
		.read-share {
			margin-top: 5px;
			color: #8B8B8B;
		}
		.read-share img {
			width: 20px;
			height: 20px;
			margin-right: 5px;
			vertical-align: middle;
		}
		.read-share span {
			vertical-align: middle;
		}
		/*.read-share img:nth-child(3) {
			margin-left: 25px;
		}
		.read-share img:nth-child(5) {
			margin-left: 25px;
		}
		.read-share img:nth-child(7) {
			margin-left: 25px;
		}*/
		.content-source {
			position: absolute;
			top: 0;
			right: 0;
			width: 50px;
			height: 50px;
		}
		.content-source.quote {
			background: url(../../img/myExtension/content-quote.png) no-repeat;
			background-size: 100% 100%;
		}
		.content-source.original {
			background: url(../../img/myExtension/content-original.png) center;
			background-size: 100% 100%;
		}
		.no-content-prompt {
			margin-top: 50px;
			text-align: center;
			color: #666666;
		}
		.qrcode-code {
			height: 350px;
			padding-top: 30px;
			text-align: -webkit-center;
		}
		.qrcode-code img{
			height: 300px;
			width: 300px;
		}
		/*预览model*/
		.preview-content {
			display: flex;
		}
		.phone-model {
			width: 260px;
			height: 500px;
			margin: 50px 70px;
			padding: 95px 15px 58px 13px;
			background: url(../../img/myExtension/phone-model.png) no-repeat;
			background-size: 100% 100%;
		}
		.phone-content {
			position: relative;
			width: 100%;
			height: 100%;
			padding: 0 0 10px 10px;
			color: #666666;
		}
		#previewArticle {
			padding-top: 10px;
			padding-bottom: 50px;
		}
		.phone-title {
			color: #111;
			/*font-size: 16px;*/
		}
		.phone-body {
			font-size: 12px;
		}
		.phone-body img {
			max-width: 100%;
			height: auto;
		}
		.scan-wechat {
			margin-top: 70px;
		}
		.preview-qrcode {
			width: 386px;
			height: 220px;
			border: 1px solid #A1A1A1;
			text-align: center;
		}
		.preview-qrcode .qrcode {
			width: 150px;
			height: 150px;
			margin: 0 auto;
			margin-top: 25px;
			border: 1px solid #A1A1A1;
		}
		.preview-qrcode .qrcode canvas {
			width: 100%;
			height: 100%;
		}
		.preview-qrcode .prompt {
			margin-top: 10px;
			color: #6B6B6B;
		}
		.wechat-share {
			margin-top: 110px;
			padding: 10px;
			width: 386px;
			height: 132px;
			border: 1px solid #A1A1A1;
		}
		.wechat-title {
			font-size: 16px;
			color: #666666;
		}
		.wechat-content {
			display: flex;
			margin-top: 20px;
		}
		.wechat-describe {
			width: calc(100% - 80px);
			height: 62px;
			color: #8E8E8E;
			display: -webkit-box;
		    overflow: hidden;
		    white-space: normal!important;
		    text-overflow: ellipsis;
		    word-wrap: break-word;
		    -webkit-line-clamp: 3;
		    -webkit-box-orient: vertical;
		}
		.wechat-icon img {
			vertical-align: top;
			margin-left: 10px;
			width: 60px;
			height: 60px;
		}
		/*nar报名卡片*/
		.mui-bar {
			position: absolute;
			font-size: 12px;
		}
		.tickets-tab {
			display: none;
		}
		.enroll-tab {
			display: none;
		}
		.goods-tab {
			display: none;
		}
		.mui-bar .mui-btn,.mui-bar button {
			font-size: 12px;
		}
		.title-item {
			display: table-cell;
			-webkit-flex: 1;
			-moz-box-flex: 1;
			-ms-flex: 1;
			flex: 1;
			vertical-align: middle;
			padding-left: 10px;
			color: #333;
		}
		.btn-item {
			width: 85px;
			display: table-cell;
			text-align: center;
		}
		.mui-bar .mui-btn {
			padding: 6px 12px;
		}
		/*nar名片卡片*/
		.card-tab {
			display: none;
		}
		.merge-tab {
			display: none;
		}
		.merge-qrcode-item {
			display: none;
		}
		.merge-enroll-item {
			display: none;
		}
		.merge-ticket-item {
			display: none;
		}
		.merge-user-item {
			display: none;
			position: relative;
			display: table-cell;
			vertical-align: middle;
			padding-left: 10px;
			-webkit-flex: 1;
			-moz-box-flex: 1;
			-ms-flex: 1;
			flex: 1;
			height: 50px;
		}
		.user-item {
			position: relative;
			display: table-cell;
			vertical-align: middle;
			padding-left: 5px;
			-webkit-flex: 1;
			-moz-box-flex: 1;
			-ms-flex: 1;
			flex: 1;
			height: 50px;
		}
		.head-img {
			position: absolute;
			top: -15px;
			width: 45px;
			height: 45px;
			padding: 1px;
			border-radius: 50%;
			background-color: #fff;
		}
		.head-img img {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
		.qrcode-item {
			display: table-cell;
		}
		.phone-item {
			display: table-cell;
		}
		.icon-item {
			width: 30px;
			height: 30px;
			border-left: 1px solid #CBCBCB;
			vertical-align: middle;
 		   	text-align: center;
		}
		.icon-item img {
			width: 15px;
			height: 15px;
		}
		.user-info-bar {
			margin-left: 48px;
			color: #333;
		}
		.user-info-bar .name {
			margin-right: 10px;
		}
		.user-info-bar .position {
			font-size: 12px;
			color: #666666;
		}
		
		/*手机页面*/
		@media (max-width: 767px) { 
			.search-content {
				width: 60%;
				background: url(../../img/myExtension/search-input-phone.png) no-repeat center;
				background-size: 100% 100%;
			}
			.search-content input[type="search"] {
				width: calc(100% - 25px);
				margin-left: 25px;
			}
			.publish-button {
				width: 37%;
			}
			.label-content .label-group {
				width: calc(100% - 74px);
			}
			.label-content .label-group .label {
				margin-left: 10px;
				padding: 3px 15px
			}
			.sort-key span {
				padding: 0 5px;
			}
			.floating-layer {
				opacity: 1;
			}
		}	
	</style>
</head>
<body>
	<div class="content">
		<div class="search-button">
			<div class="search-content">
				<input id="searchInput" type="search" class="form-control" placeholder="输入文章标题">
			</div>
			<!--<div class="btn-group btn-group-justified publish-button" role="group" aria-label="button-group">
				<div class="btn-group" role="group">
					<button type="button" data-param="1" class="btn btn-default active">已发布</button>
				</div>
				<div class="btn-group" role="group">
					<button type="button" data-param="0" class="btn btn-default">未发布</button>
				</div>
			</div>-->
		</div>
		<div class="label-content">
			<div class="label-group">
				<label>标签：</label>
				<span class="label label-default active unlimited">不限</span>
			</div>
			<div class="more-label">
				<a href="javascript:void(0)">更多标签</a>
				<img src="../../img/myExtension/more-down.png" />
			</div>
		</div>
		<div class="sort-key">
			<label>排序：</label>
			<span class="label active" data-param="1">最新内容</span>
			<span class="label" data-param="2">点赞次数</span>
			<span class="label" data-param="3">阅读次数</span>
			<span class="label" data-param="4">转发次数</span>
		</div>
		<div class="row row-list">
			<!--<div class="no-content-prompt">您还没有推文信息哦！<a>去原创吧</a></div>-->
			<!--<div class="col-sm-6 col-lg-3">
				<div class="thumbnail">
					<div class="img-layer">
						<img class="main-img" src="../../img/test-back.jpg" alt="...">
						<div class="floating-layer">
							<div class="float-btn">
								<p><button class="btn btn-default" type="button">脉络图</button></p>
								<p><button class="btn btn-default" type="button">报名名单</button></p>
							</div>
							<div class="float-bottom">
								<div class="delete">
									<img src="../../img/myExtension/delete.png" /><span>删除</span>
								</div>
								<div class="edite">
									<img src="../../img/myExtension/edite.png" /><span>编辑</span>
								</div>
							</div>
						</div>
					</div>
					<div class="caption">
						<div class="icon-bar">
							<img src="../../img/myExtension/content-hongbao.png" />
							<img src="../../img/myExtension/content-enroll.png" />
							<img src="../../img/myExtension/content-coupon.png" />
							<img src="../../img/myExtension/content-order.png" />
						</div>
						<div class="content-source quote"></div>
						<div class="text-title text-ellipsis">文章标题</div>
						<div class="push-time">发布时间：2018-4-19 16:23:05</div>
						<div class="read-share space-between">
							<img src="../../img/myExtension/content-read.png" /><span>12342</span><img src="../../img/myExtension/content-share.png" /><span>12321</span>
						</div>
					</div>
				</div>
			</div>-->
		</div>
		
		<nav id="page" class="text-center" aria-label="Page navigation">
			<ul class="pagination">
			</ul>
		</nav>
		<div class="modal fade bs-example-modal-lg" id="qrcodeModal" tabindex="-1" role="dialog" aria-labelledby="qrcodeModalLabel">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
					    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					    	<h4 class="modal-title" id="qrcodeModalLabel">验票二维码</h4>
					</div>
				  	<div class="modal-body">
				    		<div class="qrcode-code"></div>
				  	</div>
				</div>
			</div>
		</div>
	</div>
	<!--预览model-->
	<div class="modal fade bs-example-modal-lg" id="previewModel" tabindex="-1" role="dialog" aria-labelledby="previewLabel">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-content">
				<div class="modal-header">
			    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			    	<h4 class="modal-title" id="previewLabel">预览</h4>
				</div>
			  	<div class="modal-body">
			  		<div class="preview-content">
				    	<div class="phone-model">
				    		<div class="phone-content">
				    			<div id="previewArticle" class="refresh-scroll">
					    			<!--<p class="phone-title">标题</p>
					    			<h6>2018-5-7 <a>张三丰</a></h6>
					    			<div class="phone-body">
	                            	    
					    			</div>-->
								</div>
								<!--报名-->
								<nav class="mui-bar mui-bar-tab enroll-tab">
									<div class="title-item">
										
									</div>
									<div class="btn-item">
										<button type="button" class="mui-btn btn-theme">立即报名</button>
									</div>
								</nav>
								<!--门票-->
								<nav class="mui-bar mui-bar-tab tickets-tab">
									<div class="title-item">
										
									</div>
									<div class="btn-item">
										<button type="button" class="mui-btn btn-theme">立即领票</button>
									</div>
								</nav>
								<!--商品-->
								<nav class="mui-bar mui-bar-tab goods-tab">
									<div class="title-item">
										
									</div>
									<div class="btn-item">
										<button type="button" class="mui-btn btn-theme">立即购买</button>
									</div>
								</nav>
								<!--名片插件管理-->
								<nav class="mui-bar mui-bar-tab card-tab">
									<div class="user-item">
										<!--<a class="head-img">
											<img src="../../img/login/logo.png" />	
										</a>
										<div class="user-info-bar">
											<span class="name">张三丰</span><span class="position">销售总监</span><br />
											<a class="phone" href="tel:">1383838438</a>
										</div>-->
									</div>
									<div class="icon-item qrcode-item customer-wechat-click">
										<img src="../../img/phone/wechat-icon.png" />
									</div>
									<a class="icon-item phone-item customer-phone-click" href="#">
										<img src="../../img/phone/phone-icon.png" />
									</a>
								</nav>
								<!--名片和报名和门票-->
								<nav class="mui-bar mui-bar-tab merge-tab">
									<div class="merge-user-item">
										<!--<a class="head-img">
											<img src="../../img/login/logo.png" />	
										</a>
										<div class="user-info-bar">
											<span class="name">用户名字</span><span class="position">销售总监</span><br />
											<a class="phone" href="tel:18685306265">18685306265</a>
										</div>-->
									</div>
									<div class="icon-item merge-qrcode-item customer-wechat-click">
										<img src="../../img/phone/wechat-icon.png" />
									</div>
									<div class="icon-item merge-enroll-item">
										<!--<span class="text-11B5AB">报名</span>-->
									</div>
									<div class="icon-item merge-goods-item">
										<!--<span class="text-11B5AB">购买</span>-->
									</div>
									<div class="icon-item merge-ticket-item">
										<!--<span class="text-11B5AB">领票</span>-->
									</div>
								</nav>
				    		</div>
				    	</div>
				    	<div class="scan-wechat">
				    		<div class="preview-qrcode">
				    			<div class="qrcode"></div>
				    			<div class="prompt">
				    				微信扫一扫，开始分享
				    			</div>
				    		</div>
				    		<div class="wechat-share">
				    			<!--<div class="wechat-title text-ellipsis"></div>
				    			<div class="wechat-content">
				    				<div class="wechat-describe"></div>
				    				<div class="wechat-icon">
				    					<img src="../../img/HBuilder.png"/>
				    				</div>
				    			</div>-->
				    		</div>
				    	</div>
			    	</div>
			  	</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="../../js/utils/jquery-1.12.4.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/bootstrap.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/jquery.cookie.js" ></script>
	<script type="text/javascript" src="../../js/utils/page.js" ></script>
	<script type="text/javascript" src="../../js/utils/toastr.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/jquery.qrcode.min.js" ></script>
	<script type="text/javascript">
		document.write('<script type="text/javascript" src="../../js/utils/boot.js?v='+new Date().getTime()+'" ><\/script>');
	</script>
	<script>
		var userID,companyID,isPublish=1,lableID,title,order=1,PageNum=1;
		$(function(){
			userID = $.cookie("userID");
			companyID = $.cookie("companyID");
			toastr.options = {
                "timeOut": 2000,
                "positionClass": "toast-middle-center"
            };
			initGetTweets();
			//获取个人标签
			base.postData(base.url.getMyLableList, {userID:userID,companyID:companyID,type:1}, callbackGetMyLableList);
		});
		function initGetTweets(){
			//获取推文内容
			var data = {
				userID:userID,
				companyID:companyID,
				isPublish:isPublish,
				title:title,
				lableID:lableID,
				order:order,
				pageNo:PageNum,
				type:1,
				pageSize:8
			}
			base.postData(base.url.getTweetsContent, data, callbackGetTweets);
		};
		//推文返回
		function callbackGetTweets(data) {
			if (data.success) {
				var html = '';
				for (var i=0; i<data.context.articleList.length; i++) {
					html += pingTweetsContent(data.context.articleList[i]);
				}
				$(".row-list").html(html);
				if (PageNum == 1){
					//初始化分页
					var totalPage = Math.ceil(data.context.totalPage/8);
					var page = {
						pageIndex:1,//初始页数
						currentPage:1,//当前页
						showPage:5,//显示页数
						totalPage:totalPage,//总页数
						onPageClick: function(page) {
							$("#page").initPage(page);
							PageNum = page.currentPage;
							initGetTweets();
			    			return false;  //默认的翻页事件
					    }
					};
					$("#page").initPage(page);
				}
			}else {
				var html = '<div class="no-content-prompt">您还没有推文信息哦！<a href="javascript:void();" onclick="goCreateCentent();">去原创吧</a></div>';
				$(".row-list").html(html);
			}
		}
		function pingTweetsContent(data) {
			var plugNum = 0;
//			if (data.isRedPackage == 1) {
//				plugNum ++;
//			}
			if (data.isEnroll == 1) {
				plugNum ++;
			}
			if (data.isVoucher == 1) {
				plugNum ++;
			}
			if (data.isOrder == 1) {
				plugNum ++;
			}
			var html = '<div class="col-sm-6 col-lg-3">'+
						'	<div class="thumbnail">'+
						'		<input type="hidden" name="articleID" value="'+data.articleID+'" />'+
						'		<input type="hidden" name="category" value="'+data.category+'" />'+
						'		<input type="hidden" name="goodsID" value="'+data.goodsId+'" />'+
						'		<input type="hidden" name="articleUserID" value="'+data.articleUserID+'" />'+
						'		<div class="img-layer">'+
						'			<img class="main-img" src="'+data.articleImage+'" alt="...">'+
						'			<div class="floating-layer">';
						if (plugNum == 0){
				html +=	'				<div class="float-btn">';
						}else if (plugNum > 1) {
				html +=	'				<div class="float-btn" style="margin-top:20px">';		
						}else{
				html +=	'				<div class="float-btn">';		
						}
				html +=	'					<div class="btn-background skeleton">脉络图</div>';
				html +=	'					<div class="btn-background preview-model">预览</div>';
						if (data.isEnroll == 1) {
				html +=	'					<div class="btn-background enroll-list">报名名单</div>';	
						}
						if (data.isVoucher == 1) {
				html +=	'					<p><button class="btn btn-default" type="button">代金券列表</button></p>';	
						}
						if (data.isOrder == 1) {
				html +=	'					<p><button class="btn btn-default order-list" type="button">订单列表</button></p>';
						}
						if (data.isTickets == 1) {
				html +=	'					<div class="btn-background QRCode">生成验票码</div>';
						}
				html +=	'				</div>'+
//						'				<div class="float-bottom">'+
//						'					<div class="delete">'+
//						'						<img src="../../img/myExtension/delete.png" /><span>删除</span>'+
//						'					</div>'+
//						'					<div class="edite">'+
//						'						<img src="../../img/myExtension/edite.png" /><span>编辑</span>'+
//						'					</div>'+
//						'				</div>'+
						'			</div>'+
						'		</div>'+
						'		<div class="caption">'+
						'			<div class="icon-bar">';
						if (data.isRedPackage == 1) {
				html += '				<img src="../../img/myExtension/content-hongbao.png" />';		
						}
						if (data.isEnroll == 1) {
				html += '				<img src="../../img/myExtension/content-enroll.png" />';			
						}
						if (data.isVoucher == 1) {
				html += '				<img src="../../img/myExtension/content-coupon.png" />';			
						}
						if (data.isOrder == 1) {
				html += '				<img src="../../img/myExtension/content-order.png" />';			
						}
				html += '				<span>作者：'+data.author+'</span>';		
				html += '			</div>';
				        if (data.isQuote == 1) {
				html += '			<div class="content-source quote"></div>';
						}else{
				html += '			<div class="content-source original"></div>';
						}
						if(!!window.navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)){
				html += '			<div style="width:320px" class="text-title text-ellipsis">'+data.articleTitle+'</div>';			
						}else{
				html += '			<div class="text-title text-ellipsis">'+data.articleTitle+'</div>';
						}
				html += '			<div class="push-time">最新时间：'+data.alterTime+'</div>'+
						'			<div class="read-share space-between">'+
						'				<div><img src="../../img/myExtension/content-read.png" /><span>'+data.readNum+'</span></div><div><img src="../../img/myExtension/content-share.png" /><span>'+data.transmitNum+'</span></div><div><img src="../../img/myExtension/content-praise.png" /><span>'+data.likeNum+'</span></div><div><img src="../../img/myExtension/user-num.png" /><span>'+data.readNumberOfPeople+'</span></div>'+
						'			</div>'+
						'		</div>'+
						'	</div>'+
						'</div>';
			return html;			
		}
		//标签返回
		function callbackGetMyLableList(data) {
			if (data.success) {
				var lableList = data.context.lableList;
				var html = '<label>标签：</label>'+
						   '<span class="label label-default active unlimited" data-param="">不限</span>';
				for (var i=0; i<lableList.length; i++) {
					html += '<span class="label label-default" data-param="'+lableList[i].id+'">'+lableList[i].lableName+'</span>';
				}
				$(".label-group").html(html);
			}
		}
		//点击发布按钮
		$(".publish-button").on("click", "button", function(){
			if ($(this).attr("class").indexOf("active") != -1) {
				return;
			}
			$(".publish-button button").removeClass("active");
			$(this).addClass("active");
			isPublish = $(this).attr("data-param");
			//获取推文内容
			PageNum=1;
			initGetTweets();
		});
		//搜索
		$('#searchInput').bind('keyup', function(event) {
			if (event.keyCode == "13") {
		　　　　//回车执行查询
				$(this).blur();
				title = $(this).val();
				PageNum=1;
				initGetTweets();
		　　	}
		});
		//点击标签
		$(".label-group").on("click", "span", function(){
			//正反选
			if ($(this).attr("class").indexOf("active") != -1) {
				$(this).removeClass("active");
			}else{
				$(this).addClass("active");
			}
			//不限和其他标签互换
			if ($(this).attr("class").indexOf("unlimited") == -1) {
				$(".unlimited").removeClass("active");
				lableID = "";
				var len = $(".label-group").find("span.active").length;
				$(".label-group").find("span.active").each(function(i){
					if (i == len - 1) {
						lableID += $(this).attr("data-param");
					}else{
						lableID += $(this).attr("data-param") + ",";	
					}
				});
				PageNum=1;
				initGetTweets();
			}else {
				$(this).siblings().removeClass("active");
				lableID = "";
				if ($(this).attr("class").indexOf("active") != -1) {
					PageNum=1;
					initGetTweets();
				}
			}
		});
		//更多标签
		$(".more-label").click(function(){
			if ($(this).find("img").attr("src").indexOf("more-down") != -1) {
				$(this).find("img").attr("src", "../../img/myExtension/more-up.png");
				if($(window).width()>=768){
					$(".label-group").css("width", "1200px");
				}
				$(".label-group").css("height", "auto");
			}else{
				$(this).find("img").attr("src", "../../img/myExtension/more-down.png");
				if($(window).width()>=768){
					$(".label-group").css("width", "800px");
				}
				$(".label-group").css("height", "29px");
			}
		});
		//点击排序
		$(".sort-key").on("click", "span", function(){
			if ($(this).attr("class").indexOf("active") != -1) {
				return;
			}	
			$(".sort-key span").removeClass("active");
			$(this).addClass("active");
			order = $(this).attr("data-param");
			PageNum=1;
			initGetTweets();
		});
		
		//鼠标悬浮
		$(".row-list").on("mouseover mouseout", ".thumbnail", function(event){
			if($(window).width()<768){
				return;
			}
			if(event.type == "mouseover"){
				//鼠标悬浮
				$(this).find(".floating-layer").css("opacity", "1");
			}else if(event.type == "mouseout"){
				//鼠标离开
				$(this).find(".floating-layer").css("opacity", "0");
			}
		});
		//跳转脉络图
		$('.row-list').on('click', '.skeleton', function(){
			var articleID = $(this).closest(".thumbnail").find("input[name='articleID']").val();
			var articleUserID = $(this).closest(".thumbnail").find("input[name='articleUserID']").val();
			if($(window).width()<768){
				window.parent.location = "../index.html?path=myExtension/connectionChartPhone.html?articleID="+articleID+"&articleUserID="+articleUserID;
			}else{
				window.parent.location = "../index.html?path=myExtension/connectionChart.html?articleID="+articleID+"&articleUserID="+articleUserID;
			}
			
		});
		//跳转报名列表
		$(".row-list").on("click", ".enroll-list", function(){
			var articleID = $(this).closest(".thumbnail").find("input[name='articleID']").val();
			window.parent.location = "../index.html?path=myExtension/enrollList.html?articleID="+articleID;
		});
		//跳转订单列表
		$(".row-list").on("click", ".order-list", function(){
			var articleID = $(this).closest(".thumbnail").find("input[name='articleID']").val();
			var goodsID = $(this).closest(".thumbnail").find("input[name='goodsID']").val();
			window.parent.location = "../index.html?path=myExtension/orderList.html?articleID="+articleID+"&goodsID="+goodsID;
		});
		//弹出验票二维码框
		$(".row-list").on("click", ".QRCode", function(){
			var _articleID = $(this).closest(".thumbnail").find("input[name='articleID']").val();
			base.postData(base.url.checkQrCode, {articleID:_articleID,companyID:companyID}, function(data) {
				if (data.success) {
					$('.qrcode-code').html('<img src="'+data.context.matrixUrl+'" />');
//		        		$('.qrcode-code').qrcode(data.context.matrixUrl);
		        		$("#qrcodeModal").modal("show");
				} else {
					toastr.error(data.msg);
				}
			});
		});
		//编辑推文
		$(".row-list").on("click", ".float-bottom .edite", function(){
			$(".top-tab li", parent.document).removeClass("active");
			$(".top-tab li", parent.document).each(function(){
				if ($(this).find("a").attr("data-href") == "myExtension/createContent.html") {
					$(this).addClass("active");
					var path = $(this).find("a").attr("data-href");
					$.cookie("menuUrl", path, {path:"/"});
					history.pushState(null, null, "index.html");
				}
			});
			var articleID = $(this).closest(".thumbnail").find("input[name='articleID']").val();
			var category = $(this).closest(".thumbnail").find("input[name='category']").val();
			if (category == 1) {
				if($(window).width()<768){
					window.parent.location = "../index.html?path=myExtension/createPhoneUrlContent.html?articleID="+articleID;
				}else{
					window.parent.location = "../index.html?path=myExtension/createUrlContent.html?articleID="+articleID;
				}
			}else{
				if($(window).width()<768){
					window.parent.location = "../index.html?path=myExtension/createPhoneContent.html?articleID="+articleID;
				}else{
					window.parent.location = "../index.html?path=myExtension/createContent.html?articleID="+articleID;
				}
			}
			
		});	
		//删除推文
		$(".row-list").on("click", ".float-bottom .delete", function(){
			var msg = confirm("确定要删除推文吗！");
			if (msg == true){
				var articleID = $(this).closest(".thumbnail").find("input[name='articleID']").val();
				base.postData(base.url.deleteAtrticleInfo, {userID:userID,companyID:companyID,articleID:articleID}, callbackDeleteAtrticle);
			}
		});
		function callbackDeleteAtrticle(data) {
			if (data.success) {
				toastr.success("删除成功");
				initGetTweets();
			}else {
				toastr.success(data.msg);
			}
		}
		//跳转去原创页面
		function goCreateCentent(){
			$(".top-tab li", parent.document).removeClass("active");
			$(".top-tab li", parent.document).each(function(){
				if ($(this).find("a").attr("data-href") == "myExtension/createContent.html") {
					$(this).addClass("active");
					var path = $(this).find("a").attr("data-href");
					$.cookie("menuUrl", path, {path:"/"});
					history.pushState(null, null, "index.html");
				}
			});
			if($(window).width()<768){
				window.parent.location = "../index.html?path=myExtension/createPhoneContent.html";
			}else{
				window.parent.location = "../index.html?path=myExtension/createContent.html";
			}
		}
		//预览
		$('.row-list').on('click', '.preview-model', function(){
			var articleID = $(this).closest(".thumbnail").find("input[name='articleID']").val();
			var articleUserID = $(this).closest(".thumbnail").find("input[name='articleUserID']").val();
			base.postData(base.url.getArticleInfo, {userID:articleUserID,companyID:companyID,articleID:articleID}, callbackGetArticleInfo);
		});
		//推文详情返回
		function callbackGetArticleInfo(data) {
			if (data.success) {
				var preview = '<p class="phone-title">'+data.context.articleTitle+'</p>'+
			    			  '<h6>'+base.getNowFormatToday()+'&nbsp;<a>'+$.cookie("userName")+'</a></h6>'+
			    			  '<div class="phone-body">'+data.context.articleContent+'</div>';
				$("#previewArticle").html(preview);
				$('.preview-qrcode .qrcode').html("");
				$('.preview-qrcode .qrcode').qrcode(data.context.QRCodeUrl);
				var wechat = '<div class="wechat-title text-ellipsis">'+data.context.articleTitle+'</div>'+
		    				'<div class="wechat-content">'+
			    			'	<div class="wechat-describe">'+data.context.articleAbstracts+'</div>'+
			    			'	<div class="wechat-icon">'+
			    			'		<img src="'+data.context.articleImage+'"/>'+
			    			'	</div>'+
			    			'</div>';
				$(".wechat-share").html(wechat);
				//插件管理
				var plugLength = data.context.pluginList.length;
				if (plugLength == 0) {//没有插件
					$("#previewArticle").css("padding-bottom","0");
				}else if (plugLength == 1) {//一种插件
					$("#previewArticle").css("padding-bottom","50px");
					//判断那种插件
					if (data.context.pluginList[0].pluginType == 0){//名片
						var card = data.context.pluginList[0].card;
						var html = '<a class="head-img customer-phone-click" href="tel:'+card.cardUserPhone+'">'+
									'	<img src="'+card.cardHeadImgUrl+'" />'+	
									'</a>'+
									'<div class="user-info-bar">'+
									'	<input type="hidden" name="cardID" value="'+card.id+'" />'+
									'	<span class="name">'+card.cardUserName+'</span><span class="position">'+card.post+'</span><br />'+
									'	<a class="phone customer-phone-click" href="tel:'+card.cardUserPhone+'">'+card.cardUserPhone+'</a>'+
									'</div>';
						$(".card-tab .user-item").html(html);
						$(".card-tab .phone-item").attr("href","tel:"+card.cardUserPhone);
						$(".user-qrcode-img").html('<img src="'+card.wxQcImgUrl+'" />');
						$(".card-tab").css("display","table");
					} else if (data.context.pluginList[0].pluginType == 1) {//报名
						$(".content").css("margin-bottom","50px");
						pluginID = data.context.pluginList[0].pluginID;
						$(".enroll-tab .title-item").text(data.context.pluginList[0].enroll.activityTitle);
						$(".enroll-tab .btn-item button").text(data.context.pluginList[0].enroll.enrollButton);
						$(".enroll-tab").css("display","table");
					}else if (data.context.pluginList[0].pluginType == 2) {//报名
						$(".content").css("margin-bottom","50px");
						pluginID = data.context.pluginList[0].pluginID;
						$(".goods-tab .title-item").text(data.context.pluginList[0].goods.title);
						$(".goods-tab").css("display","table");
					} else if (data.context.pluginList[0].pluginType == 4) {//领票
						$(".content").css("margin-bottom","50px");
						pluginID = data.context.pluginList[0].pluginID;
						$(".tickets-tab .title-item").text(data.context.pluginList[0].activity.theme);
						$(".tickets-tab").css("display","table");
					}
				}else if (plugLength > 1) {//两种插件
					for (var i=0; i<data.context.pluginList.length; i++) {
						if (data.context.pluginList[i].pluginType==0) {
							$(".merge-tab .merge-user-item").css("display", "table-cell");
							$(".merge-tab .merge-qrcode-item").css("display", "table-cell");
							var card = data.context.pluginList[i].card;
							var html = '<a class="head-img customer-phone-click" href="tel:'+card.cardUserPhone+'">'+
										'	<img src="'+card.cardHeadImgUrl+'" />'+	
										'</a>'+
										'<div class="user-info-bar">'+
										'	<input type="hidden" name="cardID" value="'+card.id+'" />'+
										'	<span class="name">'+card.cardUserName+'</span><span class="position">'+card.post+'</span><br />'+
										'	<a class="phone customer-phone-click" href="tel:'+card.cardUserPhone+'">'+card.cardUserPhone+'</a>'+
										'</div>';
							$(".merge-tab .merge-user-item").html(html);
							$(".user-qrcode-img").html('<img src="'+card.wxQcImgUrl+'" />');
						} else if (data.context.pluginList[i].pluginType==1) {
							pluginID = data.context.pluginList[i].pluginID;
							$(".merge-tab .merge-enroll-item").css("display", "table-cell");
							$(".merge-tab .merge-enroll-item").html('<span class="font-theme">报名</span>');
						} else if (data.context.pluginList[i].pluginType==2) {
							pluginID = data.context.pluginList[i].pluginID;
							$(".merge-tab .merge-goods-item").css("display", "table-cell");
							$(".merge-tab .merge-goods-item").html('<span class="font-theme">购买</span>');
						} else if (data.context.pluginList[i].pluginType==4) {
							pluginID = data.context.pluginList[i].pluginID;
							$(".merge-tab .merge-ticket-item").css("display", "table-cell");
							$(".merge-tab .merge-ticket-item").html('<span class="font-theme">领票</span>');
						}
					}
					$(".merge-tab").css("display","table");
				}
				$("#previewModel").modal('show');
			}else{
				toastr.warning(data.msg);
			}
		}	
	</script>
</body>
</html>
